home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin MDIForm MDIForm1
- Caption = "Menu Demonstration"
- Height = 4725
- Left = 4785
- LinkTopic = "MDIForm1"
- Top = 3630
- Width = 7740
- Begin PictureBox Picture1
- Align = 2 'Align Bottom
- BackColor = &H00C0C0C0&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 300
- Left = 0
- ScaleHeight = 270
- ScaleWidth = 7590
- TabIndex = 0
- Top = 3735
- Width = 7620
- Begin VBMsg VBMsg1
- Height = 420
- Left = 7080
- MessageCount = MDIMENU.FRX:0000
- MessageList = MDIMENU.FRX:0002
- MessageTypes = 0 'Selected Messages
- Top = 0
- Width = 420
- End
- End
- Begin Menu file
- Caption = "&File"
- Begin Menu new
- Caption = "&New"
- End
- Begin Menu Open
- Caption = "&Open..."
- End
- Begin Menu save
- Caption = "&Save"
- End
- Begin Menu saveas
- Caption = "Save &As..."
- End
- Begin Menu saveall
- Caption = "Sav&e All"
- End
- Begin Menu close
- Caption = "&Close"
- End
- Begin Menu sep13
- Caption = "-"
- End
- Begin Menu print
- Caption = "&Print..."
- Shortcut = ^P
- End
- Begin Menu setup
- Caption = "P&rint Setup..."
- End
- Begin Menu sep11
- Caption = "-"
- End
- Begin Menu exit
- Caption = "E&xit"
- End
- End
- Begin Menu edit
- Caption = "&Edit"
- Begin Menu undo
- Caption = "&Undo"
- Shortcut = ^Z
- End
- Begin Menu sep4
- Caption = "-"
- End
- Begin Menu cut
- Caption = "Cu&t"
- Shortcut = ^X
- End
- Begin Menu copy
- Caption = "&Copy"
- Shortcut = ^C
- End
- Begin Menu paste
- Caption = "&Paste"
- Shortcut = ^V
- End
- Begin Menu sep3
- Caption = "-"
- End
- Begin Menu find
- Caption = "&Find..."
- Shortcut = ^F
- End
- Begin Menu next
- Caption = "Find &Next"
- Shortcut = {F3}
- End
- Begin Menu replace
- Caption = "R&eplace"
- End
- End
- Begin Menu windows
- Caption = "&Window"
- WindowList = -1 'True
- Begin Menu newwindow
- Caption = "&New Window"
- End
- Begin Menu casc
- Caption = "&Cascade"
- End
- Begin Menu tile
- Caption = "&Tile"
- End
- Begin Menu arran
- Caption = "&Arrange Icons"
- End
- End
- Begin Menu help
- Caption = "&Help"
- Begin Menu cont
- Caption = "&Contents"
- End
- Begin Menu serrarc
- Caption = "&Search for Help On..."
- End
- Begin Menu how
- Caption = "&How to Use Help"
- End
- Begin Menu sep9
- Caption = "-"
- End
- Begin Menu about
- Caption = "&About..."
- End
- End
- Option Explicit
- Const MF_SYSMENU = &H2000
- Const MF_SEPARATOR = &H800
- Sub arran_Click ()
- MDIForm1.Arrange 3
- End Sub
- Sub casc_Click ()
- MDIForm1.Arrange 0
- End Sub
- Sub edit_Click ()
- Picture1.Cls
- Picture1.Print " Undo Last Changes, Perform Clipboard Operations, Search and Replace"
- End Sub
- Sub exit_Click ()
- End
- End Sub
- Sub file_Click ()
- Picture1.Cls
- Picture1.Print " Create, Open, Save, Print or Close Documents, Setup the Printer, or Ext the Application"
- End Sub
- Sub help_Click ()
- Picture1.Cls
- Picture1.Print " Get Help on the Application"
- End Sub
- Sub MDIForm_Load ()
- Load Form1 ' Load original Form1.
- Form1.Print "Use the mouse to drag through the"
- Form1.Print "menu items above. Notice on the status"
- Form1.Print "line the text associated with the item."
- Form1.Print "VB Messenger is detecting when the MDI"
- Form1.Print "parent form gets a WM_MENUSELECT message "
- Form1.Print "and interprets the results to print a "
- Form1.Print "line of text describing the menu item."
- VBMsg1.SubClasshWnd = MDIForm1.hWnd
- End Sub
- Sub newwindow_Click ()
- Static i As Integer
- i = i + 1
- ReDim Preserve F(i) As New Form1
- F(i).Caption = "Child Window"
- F(i).Show
- End Sub
- Sub tile_Click ()
- MDIForm1.Arrange 1
- End Sub
- Sub VBMsg1_WindowMessage (hWindow As Integer, Msg As Integer, wParam As Integer, lParam As Long, RetVal As Long, CallDefProc As Integer)
- Dim Dil As String
- Dim rc As Integer
- Dim MenuID As String * 40
- VBMsg1.lParam = lParam 'parse out LoWord and HiWord values
- Select Case wParam
- Case 2
- Dil = "Create a New Document"
- Case 3
- Dil = "Open an Existing Document"
- Case 4
- Dil = "Save the Document in the Active Window"
- Case 5
- Dil = "Save the Active Document under a New Name"
- Case 6
- Dil = "Save All the Open Documents"
- Case 7
- Dil = "Close the Active Document"
- Case 9
- Dil = "Print the Active Document"
- Case 10
- Dil = "Change Printer Settings"
- Case 12
- Dil = "Exit the Demo Application"
- Case 14
- Dil = "Undo the Last Changes"
- Case 16
- Dil = "Delete the Selected Text and Copy it into the Clipboard"
- Case 17
- Dil = "Copy the Selected Text into the Clipboard"
- Case 18
- Dil = "Paste the Clipboard Contents into the Active Window"
- Case 20
- Dil = "Find a Specified String in the Active Window"
- Case 21
- Dil = "Find the Next Matching String"
- Case 22
- Dil = "Replace a String in the Active Window"
- Case 24
- Dil = "Create a New Window with the Same Contents as the Active Window"
- Case 25
- Dil = "Cascade the Open Windows"
- Case 26
- Dil = "Tile the Open Windows"
- Case 27
- Dil = "Rearrange All Icons"
- Case 29
- Dil = "Display Help Contents"
- Case 30
- Dil = "Search for a Specific Help Topic"
- Case 31
- Dil = "Display Help on Using Windows Help"
- Case 33
- Dil = "Display Version Information About the Application"
- Case Is < 0
- Dil = "Make the Specified Window the Active Window"
- Case Else
- Dil = ""
- End Select
- Picture1.Cls
- Picture1.Print " " + Dil
- End Sub
- Sub windows_Click ()
- Picture1.Cls
- Picture1.Print " Manage Child Windows"
- End Sub
-